fix(FR-2870): catch storage host fetch errors in session launcher#7365
Open
ironAiken2 wants to merge 1 commit into
Open
fix(FR-2870): catch storage host fetch errors in session launcher#7365ironAiken2 wants to merge 1 commit into
ironAiken2 wants to merge 1 commit into
Conversation
Contributor
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the session launcher’s storage (folder mounting) step so that a failure to load the storage/folder list no longer blocks session creation, by catching the error and presenting a warning fallback UI.
Changes:
- Add new i18n strings for a “folder list unavailable” warning.
- Wrap the storage-step
VFolderTableFormItemwith anErrorBoundarythat renders a warningAlertfallback when folder loading fails.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| resources/i18n/en.json | Adds English strings for the “folder list unavailable” warning shown in the session launcher. |
| react/src/pages/SessionLauncherPage.tsx | Wraps the storage-step folder mount table in an error boundary and shows a warning alert fallback on failure. |
0b38f85 to
a0ca791
Compare
a0ca791 to
1a7ecd7
Compare
1a7ecd7 to
638b87d
Compare
Contributor
Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
638b87d to
23e6048
Compare
agatha197
reviewed
May 18, 2026
agatha197
reviewed
May 18, 2026
23e6048 to
40ec8a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #7364(FR-2870)
Summary
When the manager's vfolder host info fetch (
/folders/_/hosts) fails (storage proxy 500, manager unreachable, etc.), the Session Launcher previously surfaced a generic page-level error fromBAIErrorBoundary("An error has occurred.") with a reload button — the user could not tell what was actually wrong and reloading didn't help.This PR replaces that experience with a dedicated, recognizable error UI at the exact existing fetch site:
useProjectResourceGroups(packages/backend.ai-ui/src/hooks/useProjectResourceGroups.ts) is the live host-fetch path on the Session Launcher page — it powersBAIProjectResourceGroupSelect, which the launcher renders insideResourceAllocationFormItems. It already runs/scaling-groupsand/folders/_/hostsin parallel and theuseSuspenseTanQueryunderneath throws on any failure; before this change both failures were indistinguishable.Promise.alltoPromise.allSettled, then discriminate: a host-info failure is re-thrown as a taggedStorageHostFetchError, while a scaling-groups failure is re-thrown as-is and bubbles to the generic boundary. Host-info failure takes precedence when both fail because SFTP filtering depends on it./session/startroute with a newStorageHostFetchErrorBoundarywhose fallback matches theBAIErrorBoundarylook (<Result status="warning">) but shows the message "Failed to fetch storage host information." (KO: "스토리지 호스트 정보를 가져오는데 실패했습니다.") and a "Go back to the previous page" primary button that callshistory.back(). Any non-StorageHostFetchErroris re-thrown so the outerBAIErrorBoundarycontinues to render its generic UI for unrelated failures.The
useCurrentProjectatom'sPromise.allSettledpath (which silently swallows host failure intovhostInfo = undefined) is intentionally out of scope for this PR.Implementation
packages/backend.ai-ui/src/hooks/useProjectResourceGroups.ts: introduceStorageHostFetchError extends Error; rewrite thequeryFnto awaitPromise.allSettled, throwStorageHostFetchError(hostsResult.reason)when the host fetch rejects, re-throw the scaling-groups rejection otherwise. The success return shape is unchanged.packages/backend.ai-ui/src/hooks/index.ts: export the newStorageHostFetchErrorclass alongside the existinguseProjectResourceGroupsexport.react/src/components/StorageHostFetchErrorBoundary.tsx(new): wraps children withreact-error-boundary'sErrorBoundary. The fallback importsStorageHostFetchErrorfrombackend.ai-ui, checkserror instanceof StorageHostFetchError, and either renders the dedicatedResultUI or re-throws so the outerBAIErrorBoundaryhandles unrelated errors.react/src/routes.tsx: wraps<SessionLauncherPage />at the/session/startroute withStorageHostFetchErrorBoundaryso the dedicated UI replaces the page body while the breadcrumb and outer layout remain intact.resources/i18n/en.json,resources/i18n/ko.json: adderrorBoundary.StorageHostFetchFailedTitleandbutton.GoBackToPreviousPage. Other locales fall back to English (fallbackLng: 'en');/fw:i18ncan fill them in.How to test
/folders/_/hostsroute)./session/start.Resultwith the title "Failed to fetch storage host information." and a "Go back to the previous page" button. The breadcrumb above remains visible.history.back()./scaling-groups) — the existingBAIErrorBoundarybehavior (page reload prompt, debug info underglobalThis.backendaiwebui.debug) is unchanged.Verification
bash scripts/verify.sh:The TypeScript failures are pre-existing errors on
main(StatisticsPage.tsx,StorageHostSettingPage.tsx,UserCredentialsPage.tsx,UserSettingsPage.tsx,VFolderNodeListPage.tsx, plus the pre-existingErrorBoundaryJSX type error atSessionLauncherPage.tsx:1433) — none introduced by this change.Follow-ups
/fw:i18n.useCurrentProject'sresourceGroupsForCurrentProjectAtom(Promise.allSettled→vhostInfo = undefinedmasks the failure and produces an emptynonSftpResourceGroups). Deliberately out of scope for this PR.